<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    function convertTime(time = 0) {
      let h = parseInt(time / 3600);
      if (h < 10) {
        h = "0" + h;
      }
      let m = parseInt(time / 60 % 60);
      if (m < 10) {
        m = "0" + m;
      }
      let s = parseInt(time % 60);
      if (s < 10) {
        s = "0" + s;
      }
      return h + '时' + m + '分' + s + '秒';
    }

    let time = +prompt('请输入时间（单位：秒）');
    document.write(`${time}秒 = ${convertTime(time)}`);
  </script>
</body>

</html>